From: Ian Campbell Date: Thu, 11 Feb 2016 12:11:21 +0000 (+0000) Subject: tools: probe for existence of qemu-xen stderr trace backend. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~1773 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=f9b880721cd0ffa207faf90af9b02e2df3b57393;p=xen.git tools: probe for existence of qemu-xen stderr trace backend. QEMU upstream commit ed7f5f1d8db0 ("trace: convert stderr backend to log") renamed the "stderr" trace backend to "log", which breaks the xen build when pointed at a QEMU tree after that point: ./configure of QEMU fail with: "ERROR: invalid trace backends Please choose supported trace backends." Upstream also changed, in baf86d6b3ca0 ("trace: switch default backend to "log""), to use "log" as the default backend (previously it was "nop"). Use ./scripts/tracetool.py to check for the presence of the stderr backend and if it is present then explicitly enable it. If the stderr backend is not present then assume a newer QEMU which defaults to "log" and simply accept that default (there is a 1 commit window upstream where this would result in no trace backend being enabled). The check is done using the older (deprecated?) --check-backend/--backend variant of the tracetool.py options rather than the new plural versions since the singular was supported even by very old versions of QEMU. New QEMU has compatibility code but if/when that is removed we will still do the right thing i.e. no explict configuiration resulting in the upstream default (currently "log"). If the explicit selection of the "stderr" backend is required then it is now done unconditionally (not depending on debug=y), which is simpler to arrange here but also matches the newer upstream's default to "log" which is not conditional on debug being enabled either. Tested with current qemu-xen-unstable (e9d8252) and current QEMU upstream master (88c73d1), both out of tree via QEMU_UPSTREAM_URL=/path/to/qemu-xen.git. Signed-off-by: Ian Campbell Cc: Paul Durrant Cc: Anthony PERARD Reviewed-by: Paul Durrant Reviewed-by: Stefano Stabellini Acked-by: Wei Liu --- diff --git a/tools/Makefile b/tools/Makefile index cb8652c796..3f45fb9429 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -228,7 +228,7 @@ qemu-xen-dir-force-update: qemu-xen-dir-find fi ifeq ($(debug),y) -QEMU_XEN_ENABLE_DEBUG := --enable-debug --enable-trace-backend=stderr +QEMU_XEN_ENABLE_DEBUG := --enable-debug else QEMU_XEN_ENABLE_DEBUG := endif @@ -240,8 +240,14 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find source=.; \ fi; \ cd qemu-xen-dir; \ + if $$source/scripts/tracetool.py --check-backend --backend stderr ; then \ + enable_trace_backend='--enable-trace-backend=stderr'; \ + else \ + enable_trace_backend='' ; \ + fi ; \ $$source/configure --enable-xen --target-list=i386-softmmu \ $(QEMU_XEN_ENABLE_DEBUG) \ + $$enable_trace_backend \ --prefix=$(LIBEXEC) \ --libdir=$(LIBEXEC_LIB) \ --includedir=$(LIBEXEC_INC) \